cmake_minimum_required(VERSION 3.22)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Debug")
endif()

set(CMAKE_PROJECT_NAME Meauser_Distance_Device)

include("tools/gcc-arm-none-eabi.cmake")

set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

project(${CMAKE_PROJECT_NAME})
message("Build type: " ${CMAKE_BUILD_TYPE})

enable_language(C ASM)

add_executable(${CMAKE_PROJECT_NAME})

add_subdirectory(libraries)
add_subdirectory(middlewares/freertos)
add_subdirectory(middlewares/lvgl)
add_subdirectory(user_project)

target_link_libraries(${CMAKE_PROJECT_NAME}
    libraries
    freertos
    lvgl
    user_project
)

target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE

)

target_sources(${CMAKE_PROJECT_NAME} PRIVATE

)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE

)

target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE

)
